<template>
  <el-pagination
    class="margin-9"
    background
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    :current-page="pageinfo.params.page"
    :page-sizes="[15,20,30]"
    :page-size="pageinfo.params.rows"
    :pager-count="5"
    layout="total, sizes, prev, pager, next, jumper"
    :total="pageinfo.total">
  </el-pagination>
</template>
<script>
  export default {
    name:'pagetemplate',
    data() {
      return {
      }
    },
    props: ['pageinfo'],
    methods: {
      handleSizeChange(val) {
        this.pageinfo.params.rows = val;
        this.pageinfo.params.page=1;
        this.$emit('changepageinfo');
        // console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        this.pageinfo.params.page = val;
        this.$emit('changepageinfo');
        // console.log(`当前页: ${val}`);
      }
    },
  }
</script>
<style media="scoped">
  .margin-9{
    margin-top:9px
  }
  .el-pagination__jump,.el-pagination__total{
    color:#ffffff
  }
</style>
